Skip to content

QVAC-13542 feat: add pivot translation support and improve model registration logging#831

Closed
RamazTs wants to merge 2 commits into
tetherto:mainfrom
RamazTs:QVAC-13595_sdk-pivot-support
Closed

QVAC-13542 feat: add pivot translation support and improve model registration logging#831
RamazTs wants to merge 2 commits into
tetherto:mainfrom
RamazTs:QVAC-13595_sdk-pivot-support

Conversation

@RamazTs

@RamazTs RamazTs commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Users couldn't translate between language pairs that don't have direct translation models available (e.g., Spanish to Italian). They had to manually chain multiple translation calls, managing intermediate results and error handling.

How does it solve it?

Adds native pivot translation support to the Bergamot engine, automatically routing translations through an intermediate language (typically English). The SDK now handles the two-step translation internally.

How was it tested?

  • Tested Spanish → English → Italian translation with Bergamot models on macOS
  • Verified logging output shows both model names: (Spanish to English via English to Italian)
  • Ran type checking with npm run typecheck - all passing
  • Created example in examples/translation/translation-bergamot-pivot.ts

Example Usage

  import { loadModel, translate, BERGAMOT_ES_EN, BERGAMOT_EN_IT } from "@qvac/sdk";

  // Load Spanish to English as primary, English to Italian as pivot
  const modelId = await loadModel({
    modelSrc: BERGAMOT_ES_EN,
    modelType: "translation",
    modelConfig: {
      engine: "Bergamot",
      pivotModel: {
        modelSrc: BERGAMOT_EN_IT,
        // Optional pivot-specific parameters
        beamsize: 4,
        temperature: 0.3,
      }
    }
  });

  // Translates Spanish → English → Italian automatically
  const result = await translate({
    modelId,
    text: "Hola mundo",
    modelType: "nmt",
    stream: false
  });

  console.log(await result.text); // "Ciao mondo"

Changes

  • Added pivotModel configuration support in Bergamot translation engine
  • Updated translation config schema to include pivot model options
  • Added comprehensive example demonstrating pivot translation usage
  • Updated SDK to version 0.8.0 with changelog entries

Ramaz Tskhadadze added 2 commits March 11, 2026 14:52
…gging

Add support for pivot translations in Bergamot engine, enabling two-step
translations through an intermediate language when direct models aren't
available. Enhanced model registration logging to display both primary
and pivot model names for better debugging visibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant